package com.elrichuang.webedge.controller;

import com.elrichuang.webedge.client.ProductClient;
import com.elrichuang.webedge.client.UserClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private ProductClient productClient;

    @Autowired
    private UserClient userClient;

    @GetMapping("/hello")
    public String hello() {
        return productClient.sayHello("huang wei ming");
    }

    @GetMapping("")
    public String index() {
        return userClient.sayHello("");
    }
}
